<template>
  <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick">
    <el-tab-pane label="弹窗" name="first">
      <Dialog />
    </el-tab-pane>
    <el-tab-pane label="表格" name="second">
      <Table v-if="activeName == 'second'" />
    </el-tab-pane>
  </el-tabs>
</template>
<script setup lang="ts">
import { getUser } from "@/api/login"
import type { TabsPaneContext } from "element-plus"
import Dialog from "./dialog.vue"
import Table from "./table.vue"
const activeName = ref("first")

const handleClick = (tab: TabsPaneContext, event: Event) => {
  console.log(tab, event)
}
const getUserList = () => {
  getUser().then((res) => {
    console.log(res)
  })
}
onMounted(() => {
  getUserList()
})
</script>
